﻿<UserControl x:Class="GKS.XAML.UserControls.ProjectHeadMgmtUC"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:GKS.Model.ViewModels;assembly=GKS.Model"
             mc:Ignorable="d" 
             d:DesignHeight="610" d:DesignWidth="850">
    
    <UserControl.DataContext>
        <local:ProjectHeadManagementModel></local:ProjectHeadManagementModel>
    </UserControl.DataContext>
    
    <Grid Height="590" Width="840">
        <Label Content="All projects:" Height="28" HorizontalAlignment="Left" Margin="49,63,0,0" Name="label4" VerticalAlignment="Top" />
        <ListBox DisplayMemberPath="Name" Height="423" HorizontalAlignment="Left" Margin="51,92,0,0" Name="listBoxProjects" VerticalAlignment="Top" Width="183" 
                 ItemsSource="{Binding Path=AllProjectItems, Mode=OneWay}" SelectedItem="{Binding Path=ProjectSelected, Mode=TwoWay}" >
        </ListBox>

        <Label Content="All account heads for the selected project:" Height="28" HorizontalAlignment="Left" Margin="256,63,0,0" Name="label3" VerticalAlignment="Top" Width="217" />
        <ListBox  DisplayMemberPath="Value" Height="423" HorizontalAlignment="Left" Margin="257,92,0,0" Name="listBoxSelectedHeads" VerticalAlignment="Top" Width="232" 
                 ItemsSource="{Binding Path=HeadsForProject, Mode=TwoWay}" SelectedItem="{Binding Path=SelectedHeadForProject, Mode=TwoWay}" >
        </ListBox>

        <Label Content="All account heads:" Height="28" HorizontalAlignment="Left" Margin="557,63,0,0" Name="label2" VerticalAlignment="Top" Width="217" />
        <ListBox DisplayMemberPath="Value"  Height="423" HorizontalAlignment="Left" Margin="559,92,0,0" Name="listBoxRemainingHeads" VerticalAlignment="Top" Width="226" 
                 ItemsSource="{Binding Path=RemainingHeads, Mode=TwoWay}" SelectedItem="{Binding Path=SelectedRemainingHead, Mode=TwoWay}">
        </ListBox>

        <Button Content="&lt;" Height="23" HorizontalAlignment="Left" Margin="506,222,0,0" Name="addHeadButton" VerticalAlignment="Top" Width="36" Command="{Binding Path=AddHeadButtonClicked, Mode=TwoWay}" />
        <Button Content="&gt;" Height="23" HorizontalAlignment="Left" Margin="506,251,0,0" Name="removeheadButton" VerticalAlignment="Top" Width="36" Command="{Binding Path=RemoveHeadButtonClicked, Mode=TwoWay}" IsEnabled="{Binding Path=RemoveHeadEnable, Mode=TwoWay}" />
        <Label Content="Please add/remove account heads (by clicking the arrows) from the right list-box for the selected project:" Height="28" HorizontalAlignment="Left" Margin="50,32,0,0" Name="label1" VerticalAlignment="Top" />


        <Button Content="Save" Height="23" HorizontalAlignment="Left" Margin="626,534,0,0" Name="buttonSave" VerticalAlignment="Top" Width="75" Click="buttonSave_Click" />
        <Button Content="Clear" Height="23" HorizontalAlignment="Left" Margin="710,534,0,0" Name="buttonClear" VerticalAlignment="Top" Width="75" />
        <TextBlock Text="{Binding Path=NotificationMessage}" TextWrapping="Wrap" Foreground="{Binding Path=ColorCode, Mode=OneWay}" Height="51" HorizontalAlignment="Left" Margin="51,526,0,0" Name="messageTextBlock" VerticalAlignment="Top" Width="554" />
    </Grid>
</UserControl>
